package com.dospyer.provider.api;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author : peigen
 * Date: 2022/3/23 7:21 PM
 */
@Slf4j
@Service
public class ProviderApiFallback implements ProviderApi {

    @Override
    public String sayHello(Long id, String name, Integer age) {
        String result = "{'msg': 'hello, " + name + "，已降级}";
        log.info("降级逻辑 sayHello ，返回：{}", result);
        return result;
    }

    @Override
    public String createUser(User user) {
        log.info("降级逻辑 createUser ，请求：{}", user);
        return "{'msg': 'fail'}";
    }
}
